package project.menu.ordermenu;

import java.util.ArrayList;

import project.controllers.Controller;
import project.controllers.Helper;
import project.menu.IMenu;
import project.menu.IMenuItem;

public class CreatorOrder implements IMenuItem {

	private static final String name = "Add order";
	private static final String METHOD_NAME = "addOrder";
	private static final String delimiter = " ";
	private final Integer id = 4;
	private static IMenu submenu;
	private Controller controller = Controller.getInstance();

	public Integer getId() {
		return id;
	}

	public ArrayList<String> action() {
		// add order

		String parametrsOrder = controller.getNumberOrder() + delimiter
				+ controller.getFillingDate() + delimiter
				+ controller.getDeadlineDate() + delimiter
				+ controller.getBeginingDate() + delimiter
				+ controller.getPrice()+delimiter+controller.getMasterName()+delimiter+controller.getNumberGarage();
		return Helper.setParametrs(METHOD_NAME, parametrsOrder);
	}

	public String getNameItem() {

		return name;
	}

	public void setSubmenu(IMenu menu) {
		submenu = menu;
	}

	public IMenu getMenu() {
		return submenu;
	}
}
